const url = ['url1', 'url1', 'url1', 'url1', 'url1']
const pool = new Set()
const maxConcurrent = 10
const queue = []
const myRequest = url => {
  return new Promise((resolve, reject) => {
    const isFull = pool.size >= maxConcurrent
    const fn = function() {
      const p = fetch(url)
      p.finally(() => {
        pool.delete(fn)
        const next = queue.shift()
        next && pool.add(next)
        next()
      })
      p.then(resolve)
      p.catch(reject)
    }
    if(isFull) {
      queue.push(fn)
    } else {
      pool.add(fn)
      fn()
    }
  })
}